<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--引入vue的js库-->
    <script src="../js/vue.js"></script>
    <!--
        案例：js数据转成显式表格
    -->
</head>
<body>
<div id="app">
    <table border="1" cellspacing="0" width="300">
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>成绩</th>
            <th>等级</th>
        </tr>
        <!--
            1：男   2：女
            60以下  红色不及格
            [60-85) 及格
            85以上  优秀
        -->
        <tr align="center" v-for="(thisStu,index) in students">
            <td>{{index + 1}}</td>
            <td>{{thisStu.name}}</td>
            <td>
                <span v-if="thisStu.gender == 1">男</span>
                <span v-else-if="thisStu.gender == 2">女</span>
            </td>
            <td>{{thisStu.score}}</td>
            <td>
                <span v-if="thisStu.score <60" style="color:red">不及格</span>
                <span v-else-if="thisStu.score >=60 && thisStu.score<85">及格</span>
                <span v-else>优秀</span>
            </td>
        </tr>
    </table>
</div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            students: [
                {
                    name: "薛之谦",
                    gender: 1,
                    score: 90
                },
                {
                    name: "薛仁贵",
                    gender: 1,
                    score: 36
                },
                {
                    name: "薛宝钗",
                    gender: 2,
                    score: 78
                }
            ]
        },
        methods: {}
    })
</script>
</html>